package dzz.Week1;

/**
 * @author dzz
 */
public class LeetCode344_ReverseString {

    //  双指针，利用一个临时变量做为中间交换。
    class Solution {
        public void reverseString(char[] s) {
            int n = s.length;
            for (int left = 0, right = n -1; left < right; ++ left, -- right) {
                char tmp = s[left];
                s[left] = s[right];
                s[right] = tmp;
            }
        }
    }



}
